package com.ddwl.schema.bo.user;

import com.ddwl.schema.bo.base.BaseBo;
import com.ddwl.schema.model.Location;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.Pattern;

/**
 * @author Fu Zhaohui
 * @version 1.0.0
 * @date 2019/4/30 14:48
 */
@ApiModel(description = "会员Bo")
@Setter
@Getter
public class UserBo extends BaseBo {

    @ApiModelProperty("ID")
    private String id;

    @ApiModelProperty("头像")
    private String avatar;

    @Pattern(regexp = "^(\\s{0})|(1\\d{10})$", message = "手机号码格式错误")
    @ApiModelProperty("手机")
    private String mobile;

    @Length(min = 6, max = 12, message = "密码长度至少6位")
    @ApiModelProperty("密码")
    private String password;

    @ApiModelProperty("昵称")
    private String nickname;

    @Length(max = 6, message = "姓名超出限制")
    @ApiModelProperty("真实名字")
    private String realname;

    @Email(message = "邮箱格式错误")
    @ApiModelProperty("邮箱")
    private String email;

    @ApiModelProperty("定位信息")
    private Location loc;

    @ApiModelProperty("地理信息")
    private String regionId;

    @ApiModelProperty("性别")
    private Byte sex;

    @Pattern(regexp = "^(\\s{0})|(19|20)\\d{2}-(1[0-2]|0?[1-9])-(0?[1-9]|[1-2][0-9]|3[0-1])$", message = "生日格式错误")
    @ApiModelProperty("生日")
    private String birthday;

    @ApiModelProperty("店铺小程序码")
    private String shopWxaCode;

    @ApiModelProperty(value = "代理等级 0普通用户 1个人代理 2店铺代理 3区域合伙人 4永久合伙人", example = "0")
    private Integer profitLevel;


}
